Self-testing checking circuit

ABSTRACT

There is disclosed a self-testing checking circuit which checks that greater than or equal to k out of n input variables are 1. This circuit has the output (1,0) or (0,1) if the &gt; OR = k condition is satisfied and the output (0,0) or (1,1) if it is not. The circuit is self-testing, i.e., every line other than the primary inputs is tested during normal operation. The logical equation representing this circuit is (CK,N,DK,N) (AN.EK,N 1(A1,A2, . . . ,AN 1),AN.EK 1,N 1(A1,A2, . . . ,AN 1)) WHEREIN A1, . . . ,AN ARE THE N INPUT VARIABLES, EK,N,(A1,A2, . . . ,AN) DENOTES THE FUNCTION WITH THE THRESHOLD K, THE FUNCTION BEING 1 IF GREATER THAN OR EQUAL TO K OF THE N INPUT VARIABLES A1,A2, . . . ,AN ARE 1. It is suitably implemented as an OR circuit of (k) AND circuits, each of the latter AND circuits being a conjunct constituted by k of the n input variables. The function (ck,ndk,n) is a two-output threshold k function, i.e., it is (0,1) or (1,0) if greater than or equal to k out of the n input variable are 1 and (0,0) otherwise. Logical equations representing the two output k threshold function are CK,N ANA1A2 . . . AKVANA1A2 . . . AK 1AK 1V . . . VANAN K . . . AN 1 DK,N ANA1A2 . . . AK 1 V ANA1A2 . . . AK 2AK V . . . V ANAN K 1 . . . AN 1 WHEREIN V REPRESENTS THE OR function. A two-output self-testing circuit which checks for less than or equal to k out of n input variables equal to 1 is represented by the following logical equation (GK,N,HK,N) (ANVFN K,N 1(A1, . . . , AN 1), ANVFN K 1,N 1 (A1, . . . , AN 1)) WHEREIN (GK,N, HK,N) IS THE TWO OUTPUT THRESHOLD WHICH IS (0,1) OR (1,0) IF LESS THAN OR EQUAL TO K OUT OF N INPUT VARIABLES ARE 1, A1, . . . ,AN ARE THE INPUT VARIABLES, FK,N IS THE FUNCTION WITH THE THRESHOLD K, I.E., IT IS 0 IF GREATER THAN OR EQUAL TO K OUT OF N INPUTS ARE 0. The function fk,n is represented by the following equation FK,N (A V A2 V A2 V . . . V AK) (A1VA2V . . . VAK 1VAK 1) . . . (AN K 1V . . . VAN) WHICH COMPRISES (K) OR circuits providing inputs to an AND circuit, each OR circuit being constituted by a disjunct of k input variables. By providing the outputs of both of the twooutput circuits mentioned above to a morphic AND circuit, there is provided a circuit which indicates whether greater than or equal to i of the input variables and less than or equal to k of the input variables are 1. When this condition is obtained, the output of the morphic AND circuit is either (0,1) or (1,0).

United States Patent Carter et al.

SELF-TESTING CHECKING CIRCUIT Inventors: William C. Carter, Ridgefield,

Conn.; Aspi B. Wadia, Shrub Oak, NY.

Primary Examiner-Eugene G. Botz Assistant Examiner-R. Stephen Dildine, Jr. Att0rneylsidore Match et al.

[57] ABSTRACT There is disclosed a self-testing checking circuit which checks that greater than or equal to k out of 11 input variables are 1. This circuit has the output (1,0) or (0,1) if the 2 k condition is satisfied and the output (0,0) or (1,1) if it is not. The circuit is self-testing, 1.e., every line other than the primary inputs is tested during normal operation. The logical equation representing this circuit is ,a,,) denotes the function with the threshold k, the function being 1 if greater than or equal to k of the n Jan. 8, 1974 a,, wherein v represents the OR function.

A two-output self-testing circuit which checks for less than or equal to k out of n input variables equal to l is represented by the following logical equation (gkm km)T( n fnk.nl( li il-l), n fnk|.n-| t a wherein (g h,, is the two output threshold which is (0,1) or (1,0) if less than or equal to k out of n input variables are 1, a,, ,a,, are the input variables, f is the function with the threshold k, i.e., it is 0 if greater than or equal to k out of n inputs are 0. The function f is represented by the following equation I f ,,=(a v a v a v (a,, v va which comprises (2) OR circuits providing inputs to an AND circuit, each OR circuit being constituted by a disjunct of k input variables. By providing the outputs of both of the two-output circuits mentioned above to a morphic AND circuit, there is provided a circuit which indicates whether greater than or equal to i of the input variables and less than or equal to k of the input variables are 1. When this condition is obtained, the output of the morphic AND circuit is either (0,1) or (1,0).

4 Claims, 9 Drawing Figures 107 A Hit) A Hi PAINTED-MN 81974 3184,97?

SHEET 3 OF 7 o 1 0 1 11 11 1 1 1 0 i O i 0 i 0 0 0 0 0 1 1 1 o 1 1 i O 0 1 1 1 0 y 1 i 1 i 1 1 1 1 1 1 O PAIENIEUJM a m sum 7 (IF 7 SELF-TESTING CHECKING CIRCUIT BACKGROUND OF THE INVENTION This invention relates to self-testing checking circuits. More particularly, it relates to a novel self-testing checking circuit which is capable of checking whether greater than or equal to k out of n input variables are 1.

It is well known to employ electronic computer comparison and logic circuits to perform two distinct types of function, viz., the exact or equality function and the greater than or equal to function 2 or, conversely, the less than or equal to function s The logic functions which implement the a function are termed threshold functions.

A computer application switch, from mathematical analysis, may use as l/O, data which is exact to control functions which use as input, measurements which are inexact and tend to lie in a well defined range, e.g., greater than equal to A but less than or equal to B. This usage can be measured employing threshold functions. In particular, these factors are important in the recognition of correct rather than incorrect patterns. It is, of course, evident that errors in a threshold circuit which is employed in pattern recognition invalidate such recognition.

As computers are used for control, particularly in real time, their reliability becomes increasingly important. Accordingly, input and the measuring circuits have to be checked. In addition, such computers control their own configuration and reliability. In this control, a most important feature is the use of threshold functions. The development of such switching and control schemes has been the object of extensive investigation heretofore. In this connection, reference is directed to U.S. Pat. No. 3,665,418 of W. G. Bouricius et al and assigned to the IBM Corporation. An important requirement of threshold circuits is that they, themselves, should also be checkable. Another important use for threshold circuits is in the threshold decoding of information codes.

Heretofore, it had been assumed that the threshold circuits, employed as mentioned hereinabove, had a lesser probability of failure than the rest of the system. Accordingly, it has been believed that the threshold circuits did not have to be checked and formed the hard core of the system, i.e., the portion which had to operate correctly for correct system operation. However, with the present advent of high reliability systems, such assumption is no longer tenable.

Accordingly, it is an important object of this system to provide self-testing checking circuits which are capable of detecting errors within threshold circuits in a computing system, a pattern recognition system, a decoding system or similar related electronic control system.

It is another object to provide a self-testing checking circuit which checks that greater than or equal to k out of n input variables are 1.

SUMMARY OF THE INVENTION In accordance with the invention, there is provided a circuit which checks that greater than or equal to k out of n input variables are 1. This circuit has the output or (0.1) if the z k condition is satisfied and (0.0) if it is not. The circuit is self-testing, i.e., every line other than the primary inputs is tested during normal operation.

The circuit is represented by the equation k,m k.n) nk,nl 1. 2. rt-l) m kl.nl ("1, 2 k n-1)) wherein e (a a ,a,,) denotes the function with threshold k, i.e., the function is 1 if greater than or equal to k of the n input variables a a a, are l and wherein (c ,,,d denotes the two output threshold k function, i.e., the latter function is equal to (0,1) or (1,0) if greater than or equal to k of the n input variables are l, and (0,0) otherwise. The function e can be implemented as an OR circuit of 6,) AND circuits; each of the latter AND circuits being a conjunct constituted by k of the n input variables. The terms c and d, are represented by the following logical equations d ,,,=a,,a,a a,,., v a a a a,, a v v a a a,, wherein v represents the OR function.

There is also provided, according to the invention, a less than or equal to k output circuit, i.e., one which gives an output of (1,0) or (0,1) if less than or equal to k out of n inputs are l. The two output less than or equal to k out of n circuit is represented by the following equation (gknu km) n fnk.n1( 1a rt-1)) wherein f is the function that is 0 if greater than or equal to k out of n inputs are 0. This function is represented by the following equation f ,,=(av v va (a va v. va ,va (a,, ,v

. va,,) which consists of (2-) OR circuits providing inputs to an AND circuit, each of the OR circuits being constituted by a disjunct of k input variables.

When the two-output circuits described hereinabove provide their output pairs to a morphic AND circuit, there results a self-testing circuit which checks whether greater than or equal to i and less than or equal to k of the input variables are I.

The foregoing and other objects, features and advantages of the invention will be apparent from the more particular description of preferred embodiments of the invention, as illustrated in the accompanying drawings.

BRIEF DESCRIPTION OF THE DRAWINGS In the drawings,

FIG. 1 is a depiction of a preferred embodiment of a self-testing circuit, constructed according to the invention, which checks whether greater than or equal to two out of four input variables are 1;

FIG. 2 is a chart which shows the values of the output lines for different values of the inputs in the circuit of FIG. 1;

FIG. 3 is a chart which shows the faults that can be detected for each possible set of inputs that can appear during normal operation in the circuit of FIG. 1;

FIG. 4 is a schematic drawing of an embodiment of a self-testing circuit, constructed according to the invention, which checks whether less than or equal to three out of four inputs are ll;

FIG. 5 is a chart which shows the values of output lines for different values of the inputs in the circuit of FIG. 4;

3 4 FIG. 6 is a chart which sets forth the faults that can icircuits ifll, 105 and 109; input a is applied to the be detected for each possible set of inputs that can ap- AND circuits 103, 105 and 111; and input a, is applied pear during normal operation in the circuit of FIG. 4; to the AND circuits 107, 109 and 111. In addition, the FIG. 7 is a block diagram of a circuit which checks output of the inverter 117, i.e., the inversion of input whether greater than or equal to i, less than or equal to a is applied to AND circuits 101, 103 and 105. The j out of n inputs are 1; output lines of AND circuits 101, 103 and 105, i.e., FIG. 8 is a schematic drawing of a particular embodiines 102, 104 and 106 respectively, are applied to an ment of the circuit shown in blue}; form in FIG, 7, L3,, OR circuit 113 which has the output line 114. The outa circuit which checks whether greater than or equal to P lines of AND circuits 109 and lines two. less than or equal to three out of four inputs are 10 110 and 112, respectively, are pp to an OR 1; circuit 115 which had the output line 116.

FIG. 9 is a chart which sets forth the faults that can In the circuit depleted in in the absence 0 e be detected for each possible set of inputs that can ap-. TOYS, Outputs are Produced 011 lines 114 and 116 of pear during normal operation in the circuit of FIG. 8. (OJ) or (110) if at least two of the inputs n 2 s a, are present. If less than two inputs are present and the circuit is error free, the outputs on lines 114 and DESCRIPTION OF A PREFERRED EMBODIMENT 115 are (0,0),

' In FIG. 2, there is shown a chart which indicates the values of the output lines of FIG. 1 for the various values of the inputs a,, a a and a, if the circuit is error The invention described hereinbelow is a generalized circuit which checks that greater than or equal to k out f 63 g q i i g g i z zz gg g zlg free. It is seen in this chart that in rows 1, 2, 3, 5, and E is i circuitc is g i e y 9, where there are less than two inputs present, the output values on lines 114 and 116 are (0,0). In all of the other than the primary Inputs ls tested durmg norother rows in the chart of FIG. 2, there are two or more ma] a inputs present and the values on lines 114 and 116 are In considering the theory underlying the invention, either (0,1) or (1,0) let ,funcnon the In FIG. 3, there is depicted a chart which shows for threshold k, re, the function is 1 if greater than or Various values ofinputs (ahazfla and 04) the ability of equal to k of the n mput Vanables are the circuit in FIG. 1 to detect lines stuck at either 0 Let denote the two outpu? threshold or 1 Where there is no entry in the chart, it signifies funcnon If greater than that the circuit will not detect lines stuck at either 0 or or equal to of the inpflt vanables are 1 1 (9,0) l for that particular set of input values. For example, otherwise. An implementation of such function is as in row 1 of FIG 3, if any one oflines 102, 104, 106 and 114 is stuck at 1, or if any of the lines 112 and 116 are 1 stuck at 0, this stuck condition will be detected when 4 1M) the input pattern of row 1 appears. It is to be noted in This implementation follows from the fact that greater the chart of FIG. 3 that each column thereby contains than equal to k out of of the input variables at least one 0 or one I. This signifies that if the proper are 1 if either n and greater than or equal to k pattern of input values are applied, and this will be the Out of of the p val'iables 1 2 n are l 40 case as these are patterns that appear during normal land greater than equal out of the operation, any one internal line that is stuck at either input variables a a ,a,. are 1. As e can be im- 0 or 1 can b detected Plemented as an OR fed y (2) AND eil'cnns each An approach similar to the approach taken in the debeing a eonlnnet Composed of exactly k of the input sign of the circuit of FIG. 1 can be taken in the designva a es, km and 1," can be implemented as fOHOWSI ing of less than equal to k out of n circuits, i.e., circuits conjuncts ofk variables out of the n-l variables a a hi h iven an output f (0,1) (1,0) if l th or ,a,, equal to k out of n inputs of I.

I aim c =fi a a (IkDE IZ G a a v v ti a (t d =a a a a va a a a a. v .va a ir-1 T T bijfifiasor kl variables out of n1 variables q a "In this latter connection, let f be the function that ,a,,. The above implementation comprises (1) is 0 if greater than or equal to k out of n inputs are 0. $11) AND circuits two OR circuits and one inverter Such function can be realized as a two level OR-AND and is self-testing. circuit expressed as follows:

The terms (If), and (11, employed hereinabove f,, (a va v v a (a va v va va correspond to the term G) as it is used in combinatorial (a,. ,a,,) OR circuit feeding a single AND mathematics. In use 6) for 0 s j s i is defined as the circuit, each OR circuit realizing a disjunct of k input number of combinations of 1 objects taken j at a time. r a 31 ...M This is equal to the integer i(i--I) (i-j+l )l( 12 A two output less than or equal to k out of n circuit, j) i.e., a circuit that gives an output of (0,1) or (1,0) if k A Reference is now made to FIG. 1 wherein there is or less of its inputs are I, can be realized as follows:

shown an embodiment of a greater than equal to two (8km, km) n v flHm-r 1 a nl)a n fnkl.nl out of four circuit. 1, n;1 MUM As seen in FIG. 1, inputzr, is applied to the AND cir- In FIG. 4, there is shown an embodiment of a selfcuits 101, 103 and107 inpufa, is applied to the AND testing less than or equal to 3 out of 4 circuit con- .of the circuits of FIGS. 1 and 4, i.e.,

structed according to the invention. This circuit is shown to have 4 inputs, i.e., b,, b b and 1),. Inputs 1),, b and b, are applied to OR circuits 119, 121 and 123, respectively. Input b, is applied to an inverter 125. The output line 118 of inverter being applied as an input to all three of OR circuits, 119, 121 and 123. The output lines 120, 122 and 124 of OR circuits 119, 121, and 123 are applied as inputs to an AND circuit 127 which has as an output line 126. The input line b, is treated as the second output line.

In FIG. 5, there is depicted a chart which indicates the values of the lines shown in FIG. 4. If the circuit is error free for various inputs as indicated in FIG. 5, the values of the output lines 126 and b, are 1,0), or (0,1 if there are less than four inputs present. If four inputs are present, the values of the output lines 126 and b, are (1,1).

In FIG. 6, there is depicted a chart which shows, for various values of inputs b b b and b, of the circuit of FIG. 4, the ability of the circuit to detect lines stuck at either 0 or 1. At those places in the chart of FIG. 6 where there is no entry, this circuit cannot detect that the line is stuck at either 0 or I for the particular set of values for input.

Using the type of threshold circuits as shown in FIGS.

1 and 4, respectively, there can be implemented window circuits, i.e., circuits which give an indication if greater than or equal to i and less than or equal to k of the input variables are 1. Such circuits can be implemented as shown in FIG. 7. In FIG. 7, the block legended m which is a morphic AND block, also termed an RCCO circuit, i.e., reduction circuit for checker outputs as described in US. Pat. No. 3,559,167, is a circuit which produces (0,1) or (1,0) output if both of the pairs have a (0,1) or (1,0). It was observed in both i and s j circuits, that there is required precisely one inverter on one of the inputs lines. In order to make the final morphic AND block A or testable in normal operation, the input line which is used in an inverter in the 2 i circuit (FIG. 1), FIG. 1 should be different from the line which is used with an inverter in the s j. Only then will all (1%) X (23 patterns appear at the input of the A block and thus make the entire circuit testable.

. In FIG. 8, there is shown an embodiment ofa greater than or equal to 2, less than or equal to 3 out of 4 circuit. In this circuit, the inputs are c,, c c and c, and input 0, is applied to AND circuits 133, 135 and 139 and to an OR circuit 145. The c is applied to AND circuits 133, 137 and 141 and to OR circuit 147. The a input is applied to an inverter 149, to AND circuits 135, 137 and 143 and to AND circuits 151 and 167. The c, input is applied to an inverter 153, to AND circuits 139, 141 and 143 and to an OR circuit 149. The output of inverter 153 which appears on a line 128 is applied to AND circuits 133, 135 and 137. The output of inverter circuit 149 which appears on a line 130 is applied to OR circuits 145, 147 and 149.

Theoutputs of AND circuits 133, and 137 which appear on lines 132, 134 and 136 are applied to an OR circuit 157 which has an output line 150. The outputs of AND circuits 139, 141 and 143 which appear on lines 138, and 142, respectively, are applied to an OR circuit 159 which has an output line 152. The outputs of OR circuits 145, 147 and 149 on lines 144, 146 and 148, respectively, are applied to an AND circuit 161 which has an output line 154. Line 154 and the c,

input are applied to AND circuit 151, AND circuit 151 having an output line 156. Lines 152 and 154 are applied as inputs to AND circuit 163 which has an output line 158. Lines 154 and are applied as inputs to AND circuit 165 which has an output line 160. Line 152 and the a input are applied to AND circuit 167 which has an output line 162. Lines 156 and 158 are applied to OR circuit 169 which has an output line 164 and lines 160 and 162 are applied to OR circuit 171 which has an output line 166. The dashed line block containing AND circuits 133, 135, 137, 139, 141 and 143 and OR circuits 157 and 159 represent an embodiment of a 2 circuit. The dashed line block containing OR circuits 145, 147 and 149 and AND circuit 161 and 0 represent a 3 circuit. The dashed line block containing AND circuits 151, 163, 165 and 167 and (1R circuits 169 and 171 represents 21 Am circuit, Le, a morphic AND (RCCO) circuit.

In the circuit shown in FIG. 8, it is to be poted that if there are less than two inputs present, the values of output lines 164 and 166 will be (0,0). For at least two inputs and not more than three inputs, the values of the output lines 164 and 166 will be (0,1) or (1,0). If four inputs are present, the values of the output lines 164 and 166 will be (1,1).

In FIG. 9, there is shown a chart which sets forth for various values of inputs (c,, 0,, c and the ability. of the circuit shown in FIG. 3 to detect lines stuck at either 0 or I. In this chart, as in the charts previously described hereinabove, if there is no entry in the table at a particular location, this signifies that the circuit cannot detect that the line is stuck at either 0 or 1 for that particular set of input values.

The circuit shown in FIG. 8 has the ability to check all inputs for stuck at l or stuck at 0 by applying inputs which are within the range of the window as discussed hereinabove. The window for the circuit of FIG. 8 is inputs greater than or equal to 2 and less than or equal to 3 out of 4 inputs. Such window dimensions do not obtain in the circuit shown in FIGS. 1 and 4. Thus, referring to FIG. 3, it is to be noted that in order to check for inputs stuck at I, it is necessary to apply less than two inputs. Similarly, as shown in FIG. 6 relative to the circuit of FIG. 4, it is to be noted that in order to check for inputs stuck at 0, it is necessary to apply four inputs.

WhiIe the invention has been particularly shown and described with reference to a preferred embodiment thereof, it will be understood by those skilled in the art that the foregoing and other changes in form and details may be made therein without departing from the spirit and scope of the invention.

What is claimed is:

1. A self-testing circuit which checks that greater than or equal to k out of n input variables are 1 comprising:

a circuit represented by the following logical equation ( kmv km) nk.n1( h 21 nl), nk-l,nl( lt 2r wherein a ,a,, are said input variables, c is a function which is implemented by a circuit comprising (Z) AND circuits, feeding an OR circuit, wherein (Z) for 0 s k s n being defined as the number of combinations of n-elements taken k at a time, which is equal to the integer n(n-1) (n-k+l )/(1'2 k), each of said last named AND circuits being a conjunct composed of k of the n input variables, and wherein (c ,,,,d (0,1) or (1,0) if greater than or equal to k out of n input variables are l and (0,0) if it is not. 2. A self-testing circuit which checks that greater than or equal to k out of n input variables are 1 coml'lSll'l p a ci icuit represented by the following logical equation (osm k...)=( k.n 1( 1, 2, a nl)a nkl.nl( l 2,

.:,.:J L- L v wherein a,, ,a,, are said input variables, e is a function which is implemented by a circuit of (5' AND circuits, feeding an OR circuit, wherein (II) for s k s n being defined as the number of combinations of n elements taken k at a time, which is equal to the integer n(n--l) (nk+1)/(l'k k), each of said AND circuits being a conjunct of k of the n input variables and (c ,,,,d is a twooutput threshold k function which is (0,1) or 1,0) if greater than or equal to k out of said n input variables are l, and (0,0) if otherwise, said two output threshold k function being represented by the following logical equations wherein a,, ,a,, have their previous significance and v represents the OR function. 3. A self-testing circuit which checks that less than or equal to k out of n input variables are 1 comprising:

a circuit represented by the following equation (gkma km) nfnk.n-1( h a n1)a nfnkl.nl( h about, wherein a,, ,a, are said input variables, and the function f,, is represented by the equation f"-k-1. .-1=( 1 2 n-k-l) 1 2 nk2 nk) k-i. n-l) wherein v represents the OR function, and which comprises (:14) OR circuits feeding a single AND circuit said term (ILL being equivalent to the term (j) for 0 s j s iwhich is defined as the number of combinations of i objects taken j at a time which is equal to the integer i(il) (ij+1)/(1'. .j), each circuit being constituted by a disjunct of n-k-l input variables; said function (g h being (0,1) or (1,0) if said k or less of said input variables are 1.

4. A self-testing arrangement which checks that greater than or equal to i and less than or equal to k of n input variables are 1 comprising:

a first circuit represented by the following logical equation i,n s i.n) ni.n1( h 2a wherein c is a function which is implemented by an OR circuit fed by (",-'j AND circuits, said term (5') for 0 s i s n is defined as the number of combinations of n elements taken i at a time, which is equal to the integer n(nl) (ni+1)/(1-2. .1), each ofsaid AND circuits being a conjunct of i of the n input variables, a ,a are said input variables, said c function being a circuit represented by the following equation c fi a a a vfi a a a, a, ,v vfi a a wherein a,, ,a,, are said n input variables and v represents the OR function, said d function being a circuit represented by the following equation d, ,,=a,,a,a a, ,va,,a,a a a,-v va,,a,,

wherein a,, ,a are said input variables and v represents the OR function;

a second circuit represented by the following equarepresents the OR function and f, is a function that is 0 if greater than or equal to k out of n inputs are 0, said function f being a circuit-represented by the equation fk.n=( i 2 k) n 2 k 1 k+1) nk+h wherein a ,a, are said input variables and v 1 UNITED STATEE PATENT OFFICE /ng CERTIFICATE 0F (CORRECTION Patent No. 3 78 i ,9 77 Dated January 8 192 fi e William C. Carter and l-lspi B. Wadia It is certified that error appemm in the above-identified patent and that said Letters Patent are hereby corrected ad shown below:

Col. 2, .l ine l7 "a V" should be a a| V..

Col. 3; l ine 36 ,a should be ,ah

col l, 1 i ne 17 "1 l5" shoul d be 1 16 I Col 6, line 36 "window" should be "window" Col 6, i ine 37' "window" should be window" Claim 2, line 116" "i'k.. should be 1'2...

Claim 2; line 24 Delete theiine Claim 2 line 25 I Delete ...a

Claim 3, line b6 "(1...j)" should be (l-2)...(j)-- ig led and sealed this 15th day of October 1974.

(SEAL) Attest:

' MCCOY M ciBsoN JR. c. MARSHALL DANN Attesting Officer Commissioner of Patents 

1. A self-testing circuit which checks that greater than or equal to k out of n input variables are 1 comprising: a circuit represented by the following logical equation (ck,n,dk,n) (an.ek,n 1(a1,a2, . . . ,an 1), an.ek 1,n 1(a1,a2, . . . ,an 1)) wherein a1, . . . ,an are said input variables, ek,n is a function which is implemented by a circuit comprising (k) AND circuits, feeding an OR circuit, wherein (k) for 0 < OR = k < OR = n being defined as the number of combinations of n elements taken k at a time, which is equal to the integer n(n1) . . . (n-k+1)/(1.2 . . . k), each of said last named AND circuits being a conjunct composed of k of the n input variables, and wherein (ck,n,dk,n) (0,1) or (1,0) if greater than or equal to k out of n input variables are 1 and (0,0) if it is not.
 2. A self-testing circuit which checks that greater than or equal to k out of n input variables are 1 comprising: a circuit represented by the following logical equation (ck,n,dk,n) (an.ek,n 1(a1,a2, . . . ,an 1), an.ek 1,n 1(a1,a2, . . . ,an 1)) wherein a1, . . . ,an are said input variables, ek,n is a function which is implemented by a circuit of (k) AND circuits, feeding an OR circuit, wherein (k) for 0 < or = k < or = n being defined as the number of combinations of n elements taken k at a time, which is equal to the integer n(n-1) . . . (n-k+1)/(1.k . . . k), each of said AND circuits being a conjunct of k of the n input variables and (ck,n,dk,n) is a two-output threshold k function which is (0,1) or (1,0) if greater than or equal to k out of said n input variables are 1, and (0,0) if otherwise, said two output threshold k function being represented by the following logical equations ck,n ana1a2 . . . akvana1a2 . . . ak 1ak 1v . . . vanan k . . . an 1 and dk,n ana1a2 . . . ak 1vana1a2 . . . ak 2akv . . . vanan k 1 . . . an 1 wherein a1, . . . ,an have their previous significance and v represents the OR function.
 3. A self-testing circuit which checks that less than or equal to k out of n input variables are 1 comprising: a circuit represented by the following equation (gk,n,hk,n) (anfn k,n 1(a1, . . . ,an 1),anfn k 1,n 1(a1, . . . ,an 1)) wherein a1, . . . ,an are said input variables, and the function fn k,n 1 is represented by the equation fn k 1,n 1 (a1va2v . . . an k 1) (a1va2v . . . van k 2van k) . . . (ak 1, . . . ,an 1) wherein v represents the OR function, and which comprises (n k 1) OR circuits feeding a single AND circuit, said term (n k 1) being equivalent to the term (j) for 0 < or = j < or = i which is defined as the number of combinations of i objects taken j at a time which is equal to the integer i(i-1) . . . (i-j+1)/(1.. . . j), each circuit being constituted by a disjunct of n-k-1 input variables; said function (gk,n,hk,n) being (0,1) or (1,0) if said k or less of said input variables are
 1. 4. A self-testing arrangement which checks that greater than or equal to i and less than or equal to k of n input variables are 1 comprising: a first circuit represented by the following logical equation (ci,n,di,n) (an.ei,n 1(a1,a2, . . . ,an 1),anei 1,n 1(a1,a2, . . . ,an 1)) wherein ci,n is a function which is implemented by an OR circuit fed by (i) AND circuits, said term (i) for 0 < or = i < or = n is defined as the number of combinations of n elements taken i at a time, which is equal to the integer n(n-1) . . . (n-i+1)/(1.2 . . . i), each of said AND circuits being a conjunct of i of the n input variables, a1, . . . ,an are said input variables, said ci,n function being a circuit represented by the followIng equation ci,n ana1a2 . . . aivana1a2 . . . ai 1ai 1v . . . vanan i . . . an 1 wherein a1, . . . ,an are said n input variables and v represents the OR function, said di,n function being a circuit represented by the following equation di,n ana1a2 . . . ai 1vana1a2 . . . ai 2aiv . . . vanan i 1 . . . an 1 wherein a1, . . . ,an are said input variables and v represents the OR function; a second circuit represented by the following equation (gk,n,hk,n) (anvfn k,n 1(a1, . . . ,an 1),anvfn k 1,n 1(a1, . . . ,an 1)) wherein a1 . . . an are said n input variables, v represents the OR function and fk,n is a function that is 0 if greater than or equal to k out of n inputs are 0, said function fk,n being a circuit represented by the equation fk,n (a1va2v . . . vak) (a1va2v . . . ak 1vak 1) . . . (an k 1, . . . ,an) wherein a1, . . . ,an are said input variables and v represents the OR function and wherein said last-named circuit comprises (k) OR circuits feeding a single AND circuit, said term (k) for 0 < or = k < or = n being defined as the number of combinations of n elements taken k at a time, which is equal to the integer n(n-1) . . . (n-k+1)/(1.2 . . . k), each of said last-named OR circuits being constituted by a disjunct of k input variables; and a morphic AND circuit for receiving the outputs of said first and second circuits to provide a single self-testing output pair. 